/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
 */

package org.apache.ranger.obs.security.token;

import org.apache.hadoop.conf.Configuration;

import java.io.IOException;

/**
 * description
 *
 * @since 2021-10-09
 */
public class MockSecretProvider implements SecretProvider {

    private static String secret = "secret";

    public static String getSecret() {
        return secret;
    }

    public static void setSecret(String new_secret) {
        secret = new_secret;
    }

    @Override
    public byte[] getSecret(Configuration conf) throws IOException {
        // return new String("secret").getBytes();
        return secret.getBytes();
    }
}